<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition template="/pages/layout/mainLayout.xhtml">
	<ui:define name="bodySemUsuario">

		<div class="post">
		<h2 class="title"><h:outputText
			value="#{bundle['locanet.Filme.busca.titulo']}" /></h2>
		<h:form>
			<table>
				<tr>
					<td><h:inputText style="width:96%" maxlength="100"
						value="#{filmeBean.busca}" /></td>
					<td><h:selectOneMenu value="#{filmeBean.estilo.id}">
						<f:selectItem itemValue="" itemLabel="" />
						<f:selectItems value="#{filmeBean.estilos}" var="e"
							itemLabel="#{e.nome}" itemValue="#{e.id}" />
					</h:selectOneMenu></td>
					<td><h:commandButton
						value="#{bundle['locanet.butoes.buscar']}"
						action="#{filmeBean.search}" /></td>
					<td><h:commandLink rendered="#{loginBean.funcionario}"
						immediate="true" action="#{filmeBean.openInsert}"
						value="#{bundle['locanet.butoes.inserir']}" /></td>
				</tr>
			</table>

		</h:form></div>
		<div class="post"><h:form>
			<table id="table_busca">
				<tr>
					<th>
					<h3><h:outputText value="#{bundle['locanet.Filme.filmes']}" /></h3>
					</th>
				</tr>
				<tr>
					<td><p:dataTable value="#{filmeBean.entities}" var="f"
						paginator="true" rows="5">

						<p:column>
							<f:facet name="header">
								<h:outputText value="#{bundle['locanet.Filme.filmes']}" />
							</f:facet>
							<div style="margin: 0px 60px 0px 60px;"><h:commandLink
								immediate="true" action="#{filmeBean.view}">
								<f:setPropertyActionListener value="#{f.id}"
									target="#{filmeBean.entity.id}" />
								<img class="img_busca" style="margin:0px" src="#{facesContext.externalContext.request.contextPath}/imgview?img=#{f.id}"/>
							</h:commandLink>
							<div class="descricao_busca"
								style="margin: 0px; text-align: right;"><h:commandLink
								immediate="true" action="#{filmeBean.view}">
								<f:setPropertyActionListener value="#{f.id}"
									target="#{filmeBean.entity.id}" />
								<b><h:outputText value="#{f.titulo}" /></b>
								<font style="color: red"><h:outputText
									rendered="#{f.status==0}"
									value="#{bundle['locanet.entidades.status.inativo']}" /></font>
								<br />
								<h:outputText value="#{ f.estilo.nome }" />
								<br />
								<h:outputText value="#{ f.dataChegada }">
									<f:convertDateTime pattern="dd/MM/yyyy" />
								</h:outputText>
								<br />
							</h:commandLink> <h:commandLink immediate="true" rendered="#{loginBean.cliente}"
								action="#{locacaoBean.addNoCarrinho}">
								<f:setPropertyActionListener value="#{f.id}"
									target="#{filmeBean.entity.id}" />
								<img class="ico"
									src="#{facesContext.externalContext.request.contextPath}/images/icon_car.png"
									title="#{bundle['locanet.locacoes.adicionarCarrinho']}" />
							</h:commandLink><br />
							<h:commandLink rendered="#{loginBean.funcionario}"
								action="#{filmeBean.openUpdate}"
								value="#{bundle['locanet.entidades.lista.editar']}">
								<f:setPropertyActionListener value="#{f.id}"
									target="#{filmeBean.entity.id}" />
							</h:commandLink> <h:commandLink rendered="#{loginBean.funcionario}"
								action="#{filmeBean.remove}"
								value="#{bundle['locanet.entidades.lista.excluir']}">
								<f:setPropertyActionListener value="#{f.id}"
									target="#{filmeBean.entity.id}" />
							</h:commandLink></div>
							</div>
						</p:column>

					</p:dataTable></td>
				</tr>
			</table>
		</h:form></div>
	</ui:define>
</ui:composition>
</html>
